package cn.com.jinhao.hotline.commons.vo.business.feedback;

import cn.com.jinhao.hotline.commons.vo.AttachRequestVO;
import cn.com.jinhao.hotline.commons.vo.BaseRequestVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;

/**
 * hotline-spring-cloud
 * <p>Description: </p>
 *
 * @author ShaneMew
 * @version 1.0
 * @date 2020/5/30
 * @since 2020/5/30
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel(value = "FeedbackRequestVO", description = "反馈请求参数")
public class FeedbackRequestVO extends BaseRequestVO {

    public interface Create {}

    public interface Update {}

    public interface Audit {}

    @ApiModelProperty(value = "主键ID")
    @NotBlank(message = "主键ID不能为空", groups = {Update.class})
    @Pattern(regexp = "^[0-9]*$", message = "派单编码(dispatchCode)必须为数字", groups = {Update.class})
    private String id;

    @ApiModelProperty(value = "事件编码")
    @NotBlank(message = "事件编码(eventCode)不能为空", groups = {Create.class})
    @Pattern(regexp = "^[0-9]*$", message = "事件编码(eventCode)必须为数字", groups = {Create.class})
    protected String eventCode;

    @ApiModelProperty(value = "派单编码")
    @NotBlank(message = "派单编码(dispatchCode)不能为空", groups = {Create.class})
    @Pattern(regexp = "^[0-9]*$", message = "派单编码(dispatchCode)必须为数字", groups = {Create.class})
    private String dispatchCode;

    /**
     * 反馈单位编码
     */
    @ApiModelProperty(value = "反馈单位编码")
    @NotBlank(message = "反馈单位编码(feedbackDeptCode)不能为空", groups = {Create.class,Update.class})
    @Pattern(regexp = "^[0-9]*$", message = "反馈单位编码(feedbackDeptCode)必须为数字", groups = {Create.class,Update.class})
    private String feedbackDeptCode;

    /**
     * 反馈单位
     */
    @ApiModelProperty(value = "反馈单位")
    @NotBlank(message = "反馈单位不能为空", groups = {Create.class,Update.class})
    private String feedbackDept;

    /**
     * 反馈人编码
     */
    @ApiModelProperty(value = "反馈人编码")
    @NotBlank(message = "反馈人编码(feedbackOperatorCode)不能为空", groups = {Create.class,Update.class})
    @Pattern(regexp = "^[0-9]*$", message = "反馈人编码(feedbackOperatorCode)必须为数字", groups = {Create.class,Update.class})
    private String feedbackOperatorCode;

    /**
     * 反馈人
     */
    @ApiModelProperty(value = "反馈人")
    @NotBlank(message = "反馈人(feedbackOperator)不能为空", groups = {Create.class,Update.class})
    private String feedbackOperator;

    /**
     * 驳回单位编码
     */
    @ApiModelProperty(value = "驳回单位编码")
    @NotBlank(message = "驳回单位编码(rejectDeptCode)不能为空", groups = {Audit.class})
    @Pattern(regexp = "^[0-9]*$", message = "驳回单位编码(rejectDeptCode)必须为数字", groups = {Audit.class})
    private String rejectDeptCode;

    /**
     * 驳回单位
     */
    @ApiModelProperty(value = "驳回单位")
    @NotBlank(message = "驳回单位(rejectDept)不能为空", groups = {Audit.class})
    private String rejectDept;

    /**
     * 驳回人编码
     */
    @ApiModelProperty(value = "驳回人编码")
    @NotBlank(message = "驳回人编码(rejectOperatorCode)不能为空", groups = {Audit.class})
    @Pattern(regexp = "^[0-9]*$", message = "驳回人编码(rejectOperatorCode)必须为数字", groups = {Audit.class})
    private String rejectOperatorCode;

    /**
     * 驳回人
     */
    @ApiModelProperty(value = "驳回人")
    @NotBlank(message = "驳回人(rejectOperator)不能为空", groups = {Audit.class})
    private String rejectOperator;

    /**
     * 接收单位编码
     */
    @ApiModelProperty(value = "接收单位编码")
    @NotBlank(message = "接收单位编码(receiveDeptCode)不能为空", groups = {Create.class, Update.class})
    @Pattern(regexp = "^[0-9]*$", message = "接收单位编码(receiveDeptCode)必须为数字", groups = {Create.class,Update.class})
    private String receiveDeptCode;

    /**
     * 接收单位
     */
    @ApiModelProperty(value = "接收单位")
    @NotBlank(message = "接收单位(receiveDept)不能为空", groups = {Create.class, Update.class})
    private String receiveDept;

    /**
     * 接收人编码
     */
    @ApiModelProperty(value = "接收人编码")
    @NotBlank(message = "接收人编码(receiveOperatorCode)不能为空", groups = {Create.class, Update.class})
    @Pattern(regexp = "^[0-9]*$", message = "接收人编码(receiveOperatorCode)必须为数字", groups = {Create.class,Update.class})
    private String receiveOperatorCode;

    /**
     * 接收人
     */
    @ApiModelProperty(value = "接收人")
    @NotBlank(message = "接收人(receiveOperator)不能为空", groups = {Create.class, Update.class})
    private String receiveOperator;

    /**
     * 反馈日期
     */
    @ApiModelProperty(value = "反馈日期")
    @NotBlank(message = "反馈日期(feedbackDatetime)不能为空", groups = {Create.class, Update.class})
    @Pattern(regexp = "((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]|[0-9][1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$", message = "反馈日期(feedbackDatetime)日期格式不正确", groups = {Create.class, Update.class})
    private String feedbackDatetime;

    /**
     * 审核日期
     */
    @ApiModelProperty(value = "审核日期")
    @NotBlank(message = "审核日期(auditDatetime)不能为空", groups = {Audit.class})
    @Pattern(regexp = "((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]ddd|[0-9][1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$", message = "审核日期(auditDatetime)日期格式不正确", groups = {Audit.class})
    private String auditDatetime;


    /**
     * 反馈说明
     */
    @ApiModelProperty(value = "反馈说明")
    @NotNull(message = "缺少反馈说明(feedbackDesc)", groups = {Create.class, Update.class})
    @Size(max = 4000, message = "反馈说明（feedbackDesc）不可以超过最大长度，最大长度为4000字符（2000中文)", groups = {Create.class, Update.class})
    private String feedbackDesc;

    /**
     * 审核说明
     */
    @ApiModelProperty(value = "审核说明")
    @NotNull(message = "缺少审核说明(auditDesc)", groups = {Audit.class})
    @Size( max = 4000, message = "审核说明（auditDesc）不可以超过最大长度，最大长度为4000字符（2000中文)", groups = {Audit.class})
    private String auditDesc;

    @ApiModelProperty(value = "附件列表")
    @NotNull(message = "附件列表(attachList)缺少")
    @Valid
    private List<AttachRequestVO> attachList;

}
